package com.mo.ld.activity.view

import android.os.Bundle
import android.view.View
import com.mo.ld.databinding.ActTextviewBinding
import com.mo.lib.ui.activity.BaseVbActivity
import com.mo.lib.utils.KLog
import com.mo.lib.utils.setClick
import com.mo.lib.view.textview.DynamicStyle
import com.xuexiang.xaop.annotation.SingleClick

/**
 * @ author：mo
 * @ data：2022/4/6:16:31
 * @ 功能：打字机样式TextView ：https://gitee.com/jenly1314/SuperTextView
 *
 */
class TextViewsVbActivity : BaseVbActivity<ActTextviewBinding>() {
    val txt = "矮有钱垫脚，丑有钱整好！"
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
//        viewBinding.tvStv.setDynamicText(txt).start()
        viewBinding.tvStvFill.setOnClickListener {
            testClick(it)
        }
        viewBinding.tvStvShow.setClick {
            viewBinding.tvStv.setDynamicStyle(DynamicStyle.TYPEWRITING).start()
        }
        viewBinding.tvStvColor.setClick {
            viewBinding.tvStv.setDynamicStyle(DynamicStyle.CHANGE_COLOR).start()
        }
    }
    @SingleClick()
    private fun testClick(view: View) {
        viewBinding.tvStv.setDynamicText(txt).start()
    }

    override fun initData() {
    }

    override fun isTranslucentStatus(): Boolean {
        return true
    }
}